package com.huawei.spare.part.replace.controlsfx;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.controlsfx.control.PopOver;

/**
 *
 * @author Sedrick
 */
public class JavaFXApplication35 extends Application {

    @Override
    public void start(Stage primaryStage) {


        //Build PopOver look and feel
        Label lblName = new Label("John Doe");
        Label lblStreet = new Label("123 Hello Street");
        Label lblCityStateZip = new Label("MadeUpCity, XX 55555");
        VBox vBox = new VBox(lblName, lblStreet, lblCityStateZip);
        //Create PopOver and add look and feel
        PopOver popOver = new PopOver(vBox);



        Label label = new Label("Mouse mouse over me");
        label.setTooltip(new Tooltip("test"));
//        label.setOnMouseEntered(mouseEvent -> {
//            //Show PopOver when mouse enters label
//            popOver.show(label);
//        });

//        label.setOnMouseExited(mouseEvent -> {
//            //Hide PopOver when mouse exits label
//            popOver.hide();
//        });

        final PasswordField pf = new PasswordField();
        final Tooltip tooltip = new Tooltip();
        tooltip.setText(
                "\nYour password must be\n" +
                        "at least 8 characters in length\n"
        );
        pf.setTooltip(tooltip);


        StackPane root = new StackPane();
        root.getChildren().add(label);
        root.getChildren().add(pf);

        Scene scene = new Scene(root, 960, 750);
//        String decoratorCssPath = "/com/huawei/spare/part/views/assets/css/app.css";
//        String metro = "/com/huawei/spare/part/views/assets/css/theme-jmetro-light.css";
//        String decoratorCssAbsPath = getClass().getResource("app.css").toExternalForm();
//        scene.getStylesheets().add(getClass().getResource("app.css").toExternalForm());
//        scene.getStylesheets().add(getClass().getResource("theme-jmetro-light.css").toExternalForm());

        primaryStage.setTitle("Hello World!");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }
}